package spring.batch;

import org.springframework.batch.item.ItemWriter;

import java.util.List;

/**
 * Created by huhx on 2017-07-18.
 */
public class LoanStatusWriter implements ItemWriter<LoanStatusBean> {

    @Override
    public void write(List<? extends LoanStatusBean> items) throws Exception {
        if (items != null && items.size() != 0) {
            for (int i = 0; i < items.size(); i++) {
                LoanStatusBean loanStatus = items.get(i);
                String marryStatus = loanStatus.getMarryStatus();
                if (marryStatus != null && marryStatus.equals("1")) {
                    // 更新个贷的状态
                    System.out.println(loanStatus.getName() + ", account: " + loanStatus.getAccountNo());
                }
            }
        }
    }
}
